import MyRequest from '@/utils/request/index'

class Products {
  goodsList(id) {
    return MyRequest.get({
      url: '/goods',
      params: { id }
    })
  }
  relevantGoods({ id, limit = 16 }) {
    return MyRequest.get({
      url: '/goods/relevant',
      params: { id, limit }
    })
  }
  hotGoods({ id, limit = 16, type = 3 }) {
    return MyRequest.get({
      url: '/goods/hot',
      params: { id, limit, type }
    })
  }

  goodsCommentInfo = (id) => {
    return MyRequest.request(
      `https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`,
      'get'
    )
  }
  goodsCommentList = (id, params) => {
    return MyRequest.request(
      `https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`,
      'get',
      params
    )
  }
}

export default new Products()
